<?php 
namespace town\controller;

use town\dmod\DB;
use town\model\Comment;
use town\base\Request;
use town\tool\Page;

/**
 * 访客管
 * 封IP ???
 */
class GuestController
{

	/**
	 * 访客信息
	 */
	public function guest_l(Request $req)
	{
		$page = $req->get('town_p', 1);
		$page = (($page-1) * 10);
		$count= DB::table('Guest')->count();
		$show = (new Page($count))->html();
		
		$list = DB::table('Guest')->limit($page .',10')->orderBy('id', 'DESC')->get();

		foreach ($datas as $key => &$value) {
			$value['create_at'] = date('Y/m/d', $value['create_at']);
		}
		return view('back/guest_l', ['list'=>$list, 'pagination'=>$show]);
	}


	public function guest_e()
	{
		# code...
	}
}